// Hartzell, Hoddie, and Bauer 2010 IO

// Load original dataset
use "HHB2010 IO Rep Data.dta"

// REPLICATION
summarize
display c(k)
mdesc
tabmiss
codebook ccode
codebook year
gen gdppc = gdpen*1000
summarize

// Table 2
// Model 1
biprobit (onset signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lmtnest decadetwo decadethree) (signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lagnunder decadetwo decadethree), robust cluster (ccode)
mdesc onset signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lmtnest decadetwo decadethree signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lagnunder decadetwo decadethree
codebook year if e(sample)
codebook ccode if e(sample)

// Model 2
biprobit (onset signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lmtnest tradeopen decadetwo decadethree) (signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lagnunder decadetwo decadethree), robust cluster (ccode)
mdesc onset signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lmtnest tradeopen decadetwo decadethree signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lagnunder decadetwo decadethree
codebook year if e(sample)
codebook ccode if e(sample)

// IMPUTATION
// m = 6
clear
use "HHB2010 IO Imp Data.dta"

summarize

mi import flong, m(imp) id(ccode year) imp(Oil-decadethree lagonset-lagnunder polglob)

gen _t0 = 0
gen _t = 0
gen _d = 0
gen _st = 0

// Table 2
// Model 1
mi estimate, cmdok post: biprobit (onset signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lmtnest decadeone decadetwo decadethree) (signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lagnunder decadeone decadetwo decadethree), robust cluster (ccode)

// Model 2
mi estimate, cmdok post: biprobit (onset signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lmtnest tradeopen decadeone decadetwo decadethree) (signed gdpenl lagecgrow lagreserv polity2 polsq lpopl1 Oil prevcivwar lagsumun lagnunder decadeone decadetwo decadethree), robust cluster (ccode)

